package com.woniuxy.products.mapper;

import com.woniuxy.commons.entity.Products;
import com.woniuxy.products.entity.ProductsAndRateAndRepayment;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author author
 * @create 2021-11-16 12:07
 */
public interface ProductsMapper {

    //添加产品信息
    boolean insertProducts(Products products);

    //查看所有产品  预计查询所有表及其字表
    //分页查询：查询所有用户和用户详情表单
    public List<Products> selectProductsByPage(@Param("productsAndRateAndRepayment") ProductsAndRateAndRepayment productsAndRateAndRepayment, @Param("pageIndex") int pageIndex,
                                               @Param("pageSize") int pageSize);

    //分页查询数据条数 查询所有用户和用户详情表单
    public int selectCountProductsByPage(@Param("productsAndRateAndRepayment") ProductsAndRateAndRepayment productsAndRateAndRepayment);

    //修改表中数据
    void updateByProducts(@Param("products") Products products);


    //根据id删除表中数据
    @Delete("delete from products where pid=#{pid}")
    void deleteByPid(String pid);
}
